package com.company.nuwa.common.exception;

import com.company.nuwa.common.enumration.IBizCode;
import lombok.Data;

/**
 * All rights Reserved, Designed By Trump
 *
 * @version V1.0
 * @Description:
 * @author: Trump
 * @date: 2020/3/25
 * @Copyright: 2020 Trump Inc. All rights reserved.
 */
@Data
public class BizException extends RuntimeException {

    private int code;

    private String message;

    public BizException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public BizException(IBizCode bizCode) {
        this.code = bizCode.getCode();
        this.message = bizCode.getMessage();
    }

}
